<link href="../libs/uploader/client/fileuploader.css" rel="stylesheet" type="text/css">
<script src="../libs/uploader/client/fileuploader.js" type="text/javascript"></script>
<script type="text/javascript" src="../libs/js/jquery.blockUI.js"></script>
<script type="text/javascript">
    // clear out plugin default styling 
    jQuery.blockUI.defaults.css = {}; 
</script>
<style type="text/css">
    div.blockMsg {
        width:  40%;
        top:    30%;
        left:   30%;
        text-align: center;
        background-color: #B7080F;
        border: 1px solid #ddd;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
            -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; 
        filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); 
        -moz-opacity:.70;
        opacity:.70;
        padding: 15px;
        color: #fff;
    }
    .qq-upload-button{
        background-image: url(../libs/uploader/browse_btn.png);
        background-color: transparent;
        width: 143px;
        height: 28px;
        border-width: 0px;
        margin-left: -7px;
    }
    .qq-upload-list{
        display: none;
    }
</style>

<script type="text/javascript" src="../libs/js/fbfriendselector/jquery.facebook.multifriend.select.js"></script>
<script type="text/javascript">

    function FBFriendSelectorInit() {
      FB.api('/me', function(response) {
          jQuery("#jfmfs-container").jfmfs({
                                  max_selected: 1,
                                  max_selected_message: "valgt (in {0} of {1} selected)",
                                  friend_fields: "id,name,last_name",
                                  pre_selected_friends: [],
                                  exclude_friends: [],
                                  sorter: function(a, b) {
                                    var x = a.last_name.toLowerCase();
                                    var y = b.last_name.toLowerCase();
                                    return ((x < y) ? -1 : ((x > y) ? 1 : 0));
                                  }
                      });          
      });
    }

</script>
<style type="text/css">
    #jfmfs-friend-selector{
        width: 474px;
        background-color: white;
        height: 174px;
    }
    #jfmfs-friend-selector input {
        height: 19px;
        margin: 0 0;
        width: 117px;
    }
    #jfmfs-friend-container {
        height: 144px;
    }
    .filter-link{
        color:black;
    }
</style>
<div class="home_body" style="color:white;">
    <center>
    <?php if (true) { ?>
        <br/>
        <?php if ($view->isCommented) { ?>
        <p align="left" style="font-size:14pt;font-weight: bold;">Ditt bidrag er registrert</p>
        <?php } ?>
        <form method="post" id="submit-answer-form" style="text-align: left;width: 90%;">
            <table width="100%" border="0">
                <tr>
                    <td valign="top" style="vertical-align: top;">

                        <?php echo $view->formHTMLData; ?>
                        
                        <?php if (!$view->isCommented) { ?>                        
                        <a href="javascript:jQuery('#submit-answer-form').submit();">
                            <img src="<?php echo $this->config['template_url'];?>assets/img/760/send_btn.png" alt="Vote" />
                        </a>
                        <?php } ?>
                    </td>
                    <td width="172" valign="top">
                        <p style="line-height: 21px;">Hei <a target="_blank" style="color:white;font-weight: bolder;" href="http://www.facebook.com/profile.php?id=<?php echo $view->user['facebook_user_id']; ?>"><?php echo $view->user['name']; ?></a></p>
                        <?php if ($view->isCommented) { ?>
                        <div style="border-color: #C5CFDB;border-style: solid;border-width: 1px 0;margin-bottom: 8px;margin-top: 8px;">
                            <p style="line-height: 21px;">Øk dine vinnersjanser ved å oppfordre venner og bekjente til å stemme på ditt bidrag. Bruk Knappene under for å dele på Facebook.</p>
                            <p style="line-height: 21px;">
                                <a href="javascript:facebooktab.share();"><img src="images/facebook_button.png" style="width: 60px;" /></a>

                            <?php
                                $likeURL = $view->config['lightbox_like_url'] . "&data_id=" . $view->commentData['data_id'];
                            ?>

                            <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($likeURL); ?>&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:20px;" allowTransparency="true"></iframe>
                            </p>
                        </div>
                        <?php } ?>
                        <a target="_blank" href="http://www.facebook.com/profile.php?id=<?php echo $view->user['facebook_user_id']; ?>">
                            <img style="border-width: 0px; width: 172px;" src="<?php echo $view->user['facebook_user_picture']; ?>" /></a>
                        <p style="line-height: 21px;">Antall stemmer: <b><?php echo ($view->commentData['total_like'] == "") ? "0" : $view->commentData['total_like']; ?></b> </p>
                    </td>
                </tr>
            </table>
        </form>

    <?php } else { ?>
        <?php
        echo str_replace("[connect_to_facebook]", '<a href="javascript:contestapp.loginFacebook();"><img style="vertical-align: middle;" src="layouts/images/connec-to-fb.png" alt="Connect to facebook" /></a>', nl2br(str_replace("\\\"", "", $view->contest['signup_tab_text'])));
        ?>
            <br/>
            <br/>
    <?php } ?>
    </center>
</div>
<script type="text/javascript">
    // set up share data
    facebooktab.setFacebookShareData({
        picture:'http://ssl.socialmediatoolbox.no/contest/exist/images/logo.png',
        name:'Hjelp meg å vinne en gourmetlunsj',
        caption:'Stem på mitt bidrag slik at jeg kan invitere 5 venner på en gourmetlunsj på High Camp 2012',
        url:'<?php echo $view->config['facebooktab_share_url'] . "&app_data=" . $view->commentData['data_id']; ?>',
        actionText:'PrimusShop.no'
    });
    <?php if (!$view->isCommented) { ?>
    window.setTimeout("FBFriendSelectorInit()", 2000);
    <?php } ?>
</script>
